package domain.entities;

import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Cdamaster entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "cdamaster", catalog = "bms")
public class Cdamaster implements java.io.Serializable {

	// Fields

	private Integer id;
	private Centro centro;
	private Date fechaEnviado;
	private Date fechaFirmado;
    private String comment;
    private Date expiration;
    private Date signature;

	// Constructors

	/** default constructor */
	public Cdamaster() {
	}

	/** minimal constructor */
	public Cdamaster(Centro centro) {
		this.centro = centro;
	}

	/** full constructor */
	public Cdamaster(Centro centro, Date fechaEnviado, Date fechaFirmado) {
		this.centro = centro;
		this.fechaEnviado = fechaEnviado;
		this.fechaFirmado = fechaFirmado;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "CENTROid", nullable = false)
	public Centro getCentro() {
		return this.centro;
	}

	public void setCentro(Centro centro) {
		this.centro = centro;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "fechaEnviado", length = 10)
	public Date getFechaEnviado() {
		return this.fechaEnviado;
	}

	public void setFechaEnviado(Date fechaEnviado) {
		this.fechaEnviado = fechaEnviado;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "fechaFirmado", length = 10)
	public Date getFechaFirmado() {
		return this.fechaFirmado;
	}

	public void setFechaFirmado(Date fechaFirmado) {
		this.fechaFirmado = fechaFirmado;
	}

    @Column(name = "comment")
    public String getComment() {
        return comment;
    }

    public void setComment(String comment) {
        this.comment = comment;
    }

    @Temporal(TemporalType.DATE)
    @Column(name = "expiration", length = 10)
    public Date getExpiration() {
        return expiration;
    }

    public void setExpiration(Date expiration) {
        this.expiration = expiration;
    }

    @Temporal(TemporalType.DATE)
    @Column(name = "signature", length = 10)
    public Date getSignature() {
        return signature;
    }

    public void setSignature(Date signature) {
        this.signature = signature;
    }
}